import numpy
import matplotlib
import sklearn

# KNN分类
from sklearn.neighbors import KNeighborsClassifier

# 身高 体重 鞋码
x_train = [[185, 60, 43], [170, 70, 41], [163, 45, 36], [165, 62, 41], [165, 55, 37], [168, 60, 40]]
y_train = ["男", "男", "女", "男", "女", "女"]
# 创建KNN分类器
knn = KNeighborsClassifier(n_neighbors=3)
knn.fit(x_train, y_train)

test_data = [[182, 75, 43], [169, 45, 36]]
test_result = knn.predict(test_data)
print(test_result)
